package yhao.demo.service.person.config;

import org.apache.dubbo.config.spring.ServiceBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import yhao.demo.service.person.dubbo.PersonDubboImpl;
import yhao.demo.service.person.dubboapi.PersonDubbo;
import yhao.infra.feature.dubbo.ConfigFactory;
import yhao.infra.feature.dubbo.DubboConfig;

/**
 * 服务端配置文件写法可参考
 */
@Configuration
@Import({DubboConfig.class})
public class DubboProviderConfiguration {
    @Autowired
    @Qualifier("personDubboImpl")
    private PersonDubboImpl personDubboImpl;

    @Bean(name="personDubbo")
    public ServiceBean personDubbo(){
        return ConfigFactory.makeQuickServiceBean(PersonDubbo.class,personDubboImpl);
    }
}
